Conversation
Contributor
Author
|
Reviewed |
pnwmatt
added a commit
that referenced
this pull request
Sep 25, 2025
Key mgmt refactor, pull implementation, -sqlrsync improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors and improves the configuration, authentication, and synchronization logic for the SQLRsync client, with a strong focus on making key management more explicit, updating the configuration file structure, and improving the handling of push/pull operations. It also cleans up legacy logic, improves error handling, and enhances the -sqlrsync shareable config file process.
Configuration and Key Management Refactor:
LocalSecretsConfigandSQLRsyncDatabasestructs inclient/config.goto use more descriptive field names (e.g.,LocalPath,PushKey,CustomerSuppliedEncryptionKey) and removed the nestedLocalstruct, making key and replica management more explicit and easier to maintain. (client/config.goclient/config.goR14-R42)FindDatabaseByPath,UpdateOrAddDatabase,RemoveDatabase) to use the new field names, ensuring consistency throughout the codebase. (client/config.go[1] [2] [3]Push/Pull Authentication and CLI Improvements:
authTokenwith explicitpullKeyandpushKeyvariables and CLI flags, and improved prompts and messages for key entry, making it clearer for users when and why keys are required. (client/main.go[1] [2] [3] [4]replicaIDas a CLI flag and propagated it through the push/pull logic for better control over replica management. (client/main.goclient/main.goL611-R583)-sqlrsync File Generation and Usage:
-sqlrsyncshareable config file to include additional metadata (e.g.,replicaID,server), and improved the detection of when a new file needs to be created. (client/config.go[1] [2]client/main.go[3] [4] [5]client/main.go[1] [2] [3]Error Handling and Logging:
bridge/cgo_bridge.go[1]bridge/sqlite_rsync_wrapper.c[2]client/main.go[3] [4]Protocol and Internal Constants:
client/remote/client.go[1]client/main.go[2]These changes collectively make authentication and configuration handling more robust, user-friendly, and maintainable, while also paving the way for future enhancements to the SQLRsync client.